
//
//  CGRectArea.swift
//  SwiftDemo
//
//  Created by Jason on 15/5/28.
//  Copyright (c) 2015年 Jason Jiang. All rights reserved.
//

import UIKit

extension  CGRect {
   
    var area:CGFloat{
        
        return width * height
    }
}


extension NSString{
    
    func stringWithAbnomal(obj:AnyObject?) ->NSString{
        
        if(obj is NSString){
            
            return obj as! NSString;
            
        }else if(obj is NSNumber){
            
            let number :NSNumber = obj as! NSNumber
            let str : NSString = number.stringValue
            return str
            
        }else if(obj is NSNull){
            
            return "" as NSString
            
        }
        
        return "stirng" as NSString
    }
    
}